/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * HistoriaClinicaDlg.java
 *
 * Created on 05-ene-2012, 0:57:53
 */
package vista.personas.pacientes;

import javax.swing.JSpinner;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import util.GestorComponenteVista;
import util.components.EditorHTML;
import util.components.IntegerTextField;
import util.components.TablaABMPnl;

/**
 *
 * @author Raul
 */
public class HistoriaClinicaDlg extends javax.swing.JDialog {
     
    private GestorVistaHistoriaClinicaDlg gestorVista;
    
    /** Creates new form HistoriaClinicaDlg */
    public HistoriaClinicaDlg(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
    public HistoriaClinicaDlg( GestorVistaHistoriaClinicaDlg gestorVista) {
        super();
        this.gestorVista = gestorVista;
        initComponents();
        GestorComponenteVista.setDefaultRenderer(antecedentesHeredofamiliaresTre);
        setLocationRelativeTo(null);
        enfermedadesAbmPnl.getEliminarBtn().setEnabled(false);
    }

    public IntegerTextField getAlturaTxt() {
        return alturaTxt;
    }

    public EditorHTML getAntecedentesPersonalesNoPatologicosTxt() {
        return antecedentesPersonalesNoPatologicosTxt;
    }

    public EditorHTML getAntecedentesPersonalesPatologicosTxt() {
        return antecedentesPersonalesPatologicosTxt;
    }

    public JTextField getApellidoTxt() {
        return apellidoTxt;
    }

    public JTextField getCalleTxt() {
        return calleTxt;
    }

    public JTextField getEdadTxt() {
        return edadTxt;
    }

    public JTextArea getEnfermedadesInfecciosasDeLaInfanciaTxt() {
        return enfermedadesInfecciosasDeLaInfanciaTxt;
    }

    public JSpinner getHospitalizacionesNum() {
        return hospitalizacionesNum;
    }

    public JSpinner getIntervencionesQuirurgicasNum() {
        return intervencionesQuirurgicasNum;
    }

    public JTextField getLocalidadTxt() {
        return localidadTxt;
    }

    public JTextField getNombreTxt() {
        return nombreTxt;
    }

    public JTextField getNroHistoriaClinicaTxt() {
        return nroHistoriaClinicaTxt;
    }

    public JTextField getProvinciaTxt() {
        return provinciaTxt;
    }

    public JTextField getSexoTxt() {
        return sexoTxt;
    }

    public JSpinner getTranfusionesNum() {
        return tranfusionesNum;
    }

    public TablaABMPnl getEnfermedadesAbmPnl() {
        return enfermedadesAbmPnl;
    }
    
    void cargarArbolEnfermedadesDeParientes(Object [] jerarquia) {
        GestorComponenteVista.cargarArbolEstatico(antecedentesHeredofamiliaresTre, jerarquia);
    }
    
    public void agregarFilaTabla(Object[] fila) {
        GestorComponenteVista.agregarFilaTabla(enfermedadesAbmPnl.getTabla(),fila);
    }

    void cargarTitulosTabla(Object[] titulos) {
        int [] anchos   ={0, 20, 60,60};
        GestorComponenteVista.cargarTitulosTabla(enfermedadesAbmPnl.getTabla(),titulos,anchos);
    }

    public void actualizarTabla() {
        enfermedadesAbmPnl.actualizarTabla();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        cancelarBtn = new javax.swing.JButton();
        guardarBtn = new javax.swing.JButton();
        imprimirBtn = new javax.swing.JButton();
        gradientPanel1 = new util.components.GradientPanel();
        datosPersonalesPnl = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        nombreTxt = new util.components.CamelCaseTextField();
        jLabel2 = new javax.swing.JLabel();
        apellidoTxt = new util.components.CamelCaseTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        edadTxt = new javax.swing.JTextField();
        sexoTxt = new javax.swing.JTextField();
        nroHistoriaClinicaTxt = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        calleTxt = new util.components.CamelCaseTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        alturaTxt = new util.components.IntegerTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        provinciaTxt = new javax.swing.JTextField();
        localidadTxt = new javax.swing.JTextField();
        roundedTitlePanel2 = new util.components.RoundedTitlePanel();
        enfermedadesAbmPnl = new util.components.TablaABMPnl();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        antecedentesHeredofamiliaresTre = new javax.swing.JTree();
        antecedentesPersonalesNoPatologicosTxt = new util.components.EditorHTML();
        jPanel4 = new javax.swing.JPanel();
        intervencionesQuirurgicasNum = new javax.swing.JSpinner();
        hospitalizacionesNum = new javax.swing.JSpinner();
        jLabel7 = new javax.swing.JLabel();
        antecedentesPersonalesPatologicosTxt = new util.components.EditorHTML();
        jLabel11 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        enfermedadesInfecciosasDeLaInfanciaTxt = new javax.swing.JTextArea();
        tranfusionesNum = new javax.swing.JSpinner();
        jLabel4 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("HistoriaClinica");
        setBounds(new java.awt.Rectangle(0, 0, 0, 0));
        setModal(true);
        setResizable(false);

        cancelarBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/cancel.png"))); // NOI18N
        cancelarBtn.setText("Cancelar");
        cancelarBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelarBtnActionPerformed(evt);
            }
        });

        guardarBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/disk.png"))); // NOI18N
        guardarBtn.setText("Guardar");
        guardarBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                guardarBtnActionPerformed(evt);
            }
        });

        imprimirBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resources/printer.png"))); // NOI18N
        imprimirBtn.setText("Imprimir");
        imprimirBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                imprimirBtnActionPerformed(evt);
            }
        });

        gradientPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(java.awt.Color.lightGray));
        gradientPanel1.setGradientColor1(java.awt.Color.white);
        gradientPanel1.setGradientColor2(javax.swing.UIManager.getDefaults().getColor("Panel.background"));
        gradientPanel1.setMaximumSize(new java.awt.Dimension(1025, 32767));

        datosPersonalesPnl.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Personales"));
        datosPersonalesPnl.setOpaque(false);

        jLabel1.setText("Nombre");

        nombreTxt.setEditable(false);

        jLabel2.setText("Apellido");

        apellidoTxt.setEditable(false);

        jLabel3.setText("Sexo");

        jLabel14.setText("Edad");

        edadTxt.setEditable(false);

        sexoTxt.setEditable(false);

        nroHistoriaClinicaTxt.setEditable(false);

        jLabel9.setText("Nro Historia Clínica:");

        javax.swing.GroupLayout datosPersonalesPnlLayout = new javax.swing.GroupLayout(datosPersonalesPnl);
        datosPersonalesPnl.setLayout(datosPersonalesPnlLayout);
        datosPersonalesPnlLayout.setHorizontalGroup(
            datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(datosPersonalesPnlLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(datosPersonalesPnlLayout.createSequentialGroup()
                        .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3)
                            .addComponent(jLabel1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(nombreTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(sexoTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(datosPersonalesPnlLayout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(nroHistoriaClinicaTxt)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel14)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(apellidoTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(edadTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        datosPersonalesPnlLayout.setVerticalGroup(
            datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, datosPersonalesPnlLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(nroHistoriaClinicaTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(nombreTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(apellidoTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(sexoTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3))
                    .addGroup(datosPersonalesPnlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel14)
                        .addComponent(edadTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Domicilio"));
        jPanel1.setOpaque(false);

        calleTxt.setEditable(false);

        jLabel5.setText("Calle");

        jLabel10.setText("Altura");

        alturaTxt.setEditable(false);

        jLabel8.setText("Provincia");

        jLabel6.setText("Localidad");

        provinciaTxt.setEditable(false);

        localidadTxt.setEditable(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel6)
                    .addComponent(jLabel5)
                    .addComponent(jLabel8))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(calleTxt)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(alturaTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(localidadTxt)
                    .addComponent(provinciaTxt))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(calleTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jLabel10)
                    .addComponent(alturaTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(provinciaTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(localidadTxt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        roundedTitlePanel2.setTitle("Enfermedades");

        enfermedadesAbmPnl.setBorder(null);
        enfermedadesAbmPnl.setImpresionHabilitada(false);

        javax.swing.GroupLayout roundedTitlePanel2Layout = new javax.swing.GroupLayout(roundedTitlePanel2);
        roundedTitlePanel2.setLayout(roundedTitlePanel2Layout);
        roundedTitlePanel2Layout.setHorizontalGroup(
            roundedTitlePanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(enfermedadesAbmPnl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        roundedTitlePanel2Layout.setVerticalGroup(
            roundedTitlePanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(enfermedadesAbmPnl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jPanel3.setOpaque(false);

        jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("Heredofamiliares"));
        jScrollPane1.setOpaque(false);

        antecedentesHeredofamiliaresTre.setRootVisible(false);
        jScrollPane1.setViewportView(antecedentesHeredofamiliaresTre);

        antecedentesPersonalesNoPatologicosTxt.setBorder(javax.swing.BorderFactory.createTitledBorder("Personales No Patológicos"));
        antecedentesPersonalesNoPatologicosTxt.setOpaque(false);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(antecedentesPersonalesNoPatologicosTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 726, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(antecedentesPersonalesNoPatologicosTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addGap(0, 5, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Antecedentes", jPanel3);

        jPanel4.setOpaque(false);

        intervencionesQuirurgicasNum.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));

        hospitalizacionesNum.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));

        jLabel7.setText("Hospitalizaciones");

        jLabel11.setText("Transfusiones");

        jScrollPane3.setBorder(javax.swing.BorderFactory.createTitledBorder("Enfermedades infecciosas de la infancia"));
        jScrollPane3.setOpaque(false);

        enfermedadesInfecciosasDeLaInfanciaTxt.setColumns(20);
        enfermedadesInfecciosasDeLaInfanciaTxt.setLineWrap(true);
        enfermedadesInfecciosasDeLaInfanciaTxt.setRows(5);
        jScrollPane3.setViewportView(enfermedadesInfecciosasDeLaInfanciaTxt);

        tranfusionesNum.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(0), Integer.valueOf(0), null, Integer.valueOf(1)));

        jLabel4.setText("Intervenciones quirúrgicas");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel7)
                            .addComponent(jLabel11))
                        .addGap(47, 47, 47)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(tranfusionesNum, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(hospitalizacionesNum, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(intervencionesQuirurgicasNum, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jScrollPane3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(antecedentesPersonalesPatologicosTxt, javax.swing.GroupLayout.DEFAULT_SIZE, 714, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jScrollPane3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(intervencionesQuirurgicasNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(hospitalizacionesNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(tranfusionesNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11))
                        .addGap(24, 24, 24))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(antecedentesPersonalesPatologicosTxt, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );

        jTabbedPane1.addTab("Antecedentes Patológicos", jPanel4);

        javax.swing.GroupLayout gradientPanel1Layout = new javax.swing.GroupLayout(gradientPanel1);
        gradientPanel1.setLayout(gradientPanel1Layout);
        gradientPanel1Layout.setHorizontalGroup(
            gradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, gradientPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(gradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jTabbedPane1)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, gradientPanel1Layout.createSequentialGroup()
                        .addComponent(datosPersonalesPnl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(roundedTitlePanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        gradientPanel1Layout.setVerticalGroup(
            gradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(gradientPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(gradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(datosPersonalesPnl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 269, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(roundedTitlePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(imprimirBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(guardarBtn)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cancelarBtn)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addComponent(gradientPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(gradientPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(guardarBtn)
                        .addComponent(imprimirBtn))
                    .addComponent(cancelarBtn))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cancelarBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelarBtnActionPerformed
        gestorVista.deshacer();
        dispose();
    }//GEN-LAST:event_cancelarBtnActionPerformed

    private void guardarBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_guardarBtnActionPerformed
        gestorVista.guardar();
    }//GEN-LAST:event_guardarBtnActionPerformed

    private void imprimirBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_imprimirBtnActionPerformed
        gestorVista.imprimir();
    }//GEN-LAST:event_imprimirBtnActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(HistoriaClinicaDlg.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(HistoriaClinicaDlg.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(HistoriaClinicaDlg.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(HistoriaClinicaDlg.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the dialog */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                HistoriaClinicaDlg dialog = new HistoriaClinicaDlg(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private util.components.IntegerTextField alturaTxt;
    private javax.swing.JTree antecedentesHeredofamiliaresTre;
    private util.components.EditorHTML antecedentesPersonalesNoPatologicosTxt;
    private util.components.EditorHTML antecedentesPersonalesPatologicosTxt;
    private javax.swing.JTextField apellidoTxt;
    private javax.swing.JTextField calleTxt;
    private javax.swing.JButton cancelarBtn;
    private javax.swing.JPanel datosPersonalesPnl;
    private javax.swing.JTextField edadTxt;
    private util.components.TablaABMPnl enfermedadesAbmPnl;
    private javax.swing.JTextArea enfermedadesInfecciosasDeLaInfanciaTxt;
    private util.components.GradientPanel gradientPanel1;
    private javax.swing.JButton guardarBtn;
    private javax.swing.JSpinner hospitalizacionesNum;
    private javax.swing.JButton imprimirBtn;
    private javax.swing.JSpinner intervencionesQuirurgicasNum;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField localidadTxt;
    private javax.swing.JTextField nombreTxt;
    private javax.swing.JTextField nroHistoriaClinicaTxt;
    private javax.swing.JTextField provinciaTxt;
    private util.components.RoundedTitlePanel roundedTitlePanel2;
    private javax.swing.JTextField sexoTxt;
    private javax.swing.JSpinner tranfusionesNum;
    // End of variables declaration//GEN-END:variables

    
    
}
